package ihc.terminalbanco.gui.panels;

import ihc.terminalbanco.gui.buttons.LabelButton;
import ihc.terminalbanco.gui.events.Events;
import ihc.terminalbanco.gui.events.KeyActions;
import ihc.terminalbanco.gui.events.KeyActionsMelhorIdade;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.Border;

public class SaqueOutroValorPane extends JPanel implements RotulosInterface {

    /**
     *
     */
    private static final long serialVersionUID = 4588142694043610780L;

    public SaqueOutroValorPane(ActionListener actionListener, KeyActionsMelhorIdade keyActions, Font font) {
        this.setLayout(new BorderLayout());

        Border raisedbevel = BorderFactory.createRaisedBevelBorder();
        /*
         * Panels
         */
        //CENTER

        JPanel painelCentralPai = new JPanel();
        //painelCentralPai.setLayout(new GridLayout(3, 1, 10, 40));
        painelCentralPai.setLayout(new BorderLayout(10, 40));

        JPanel painelCentralFilhoEntrada = new JPanel();
        painelCentralFilhoEntrada.setLayout(new GridLayout(3, 2));

        JLabel caminhoLabel = new JLabel("Menu -> Saque -> Outro Valor");
        caminhoLabel.setFont(font);
        JLabel vazioLabel1 = new JLabel("");

        painelCentralFilhoEntrada.add(caminhoLabel);
        painelCentralFilhoEntrada.add(vazioLabel1);

        JLabel saldoLabel = new JLabel("<html><font color='green'>"
                + "Saldo: R$ 500,00<br></font></html>");
        saldoLabel.setFont(font);
        JLabel vazioLabel2 = new JLabel("");

        painelCentralFilhoEntrada.add(saldoLabel);
        painelCentralFilhoEntrada.add(vazioLabel2);

        JLabel comprovDia = new JLabel("Valor: ");
        comprovDia.setFont(font);
        JTextField entradaValor = new JTextField();

        painelCentralFilhoEntrada.add(comprovDia);
        painelCentralFilhoEntrada.add(entradaValor);


        painelCentralFilhoEntrada.setBorder(raisedbevel);

        JLabel notasDe1 = new JLabel("Notas de: ");
        JLabel notasDe2 = new JLabel("Notas de: ");
        JLabel notasDe3 = new JLabel("Notas de: ");
        notasDe1.setFont(font);
        notasDe1.setHorizontalAlignment(SwingConstants.RIGHT);
        notasDe2.setFont(font);
        notasDe2.setHorizontalAlignment(SwingConstants.RIGHT);
        notasDe3.setFont(font);
        notasDe3.setHorizontalAlignment(SwingConstants.RIGHT);
        JLabel cinquentaReais = new JLabel("R$ 50,00");
        cinquentaReais.setFont(font);
        JLabel vinteReais = new JLabel("R$ 20,00");
        vinteReais.setFont(font);
        JLabel dezReais = new JLabel("R$ 10,00");
        dezReais.setFont(font);

        JPanel informacao = new JPanel(new GridLayout(3, 2));

        informacao.add(notasDe1);
        informacao.add(cinquentaReais);
        informacao.add(notasDe2);
        informacao.add(vinteReais);
        informacao.add(notasDe3);
        informacao.add(dezReais);

        painelCentralPai.add(painelCentralFilhoEntrada, BorderLayout.CENTER);
        painelCentralPai.add(informacao, BorderLayout.SOUTH);

        //SOUTH
        JPanel painelSul = new JPanel();
        painelSul.setLayout(new GridLayout(1, 2,100,0));

        LabelButton sairButton;
        sairButton = new LabelButton(teclaUmString+voltarString,"images/voltar.png");
        sairButton.setFont(font);
        sairButton.setVisible(true);
        sairButton.addActionListener(actionListener);
        painelSul.add(sairButton);

        LabelButton confirmarButton;
        confirmarButton = new LabelButton(teclaDoisString+confirmarString,"images/continuar.png");
        confirmarButton.setFont(font);
        confirmarButton.setVisible(true);
        confirmarButton.addActionListener(actionListener);
        painelSul.add(confirmarButton);
/*
        JLabel cancelaLabel = new JLabel("[ANULA] - Cancela");
        cancelaLabel.setFont(font);
        painelSul.add(cancelaLabel);
        painelSul.setBorder(raisedbevel);
*/
        //Juntando
        JPanel painelCentralPrincipal = new JPanel();
        painelCentralPrincipal.setLayout(new GridLayout(1, 1));
        painelCentralPrincipal.add(painelCentralPai);

        //North inserido para dar espaço com o limite superior da tela
        JLabel tituloLabel = new JLabel("<html><br>DIGITE O VALOR DESEJADO<br><br></html>");
        tituloLabel.setFont(font);
        tituloLabel.setHorizontalAlignment(SwingConstants.CENTER);

        this.add(tituloLabel, BorderLayout.NORTH);
        this.add(painelCentralPrincipal, BorderLayout.CENTER);
        this.add(painelSul, BorderLayout.SOUTH);
    }

}
